﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace B.S.BaseData.Infratructure.Interfares
{
    /// <summary>
    /// 接口
    /// </summary>
    /// <typeparam name="T">集合</typeparam>
    public interface IBaseRequsitory<T> where T : class,new()
    {
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="item">实体</param>
        /// <returns>返回受影响行数</returns>
        Task<int> AddAsync(T item);
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="item">实体</param>
        /// <returns>返回受影响行数</returns>
        Task<int> UpdateAsync(T item);
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id">实体</param>
        /// <returns>返回受影响行数</returns>
        Task<int> DeleteAsync(int id);
        /// <summary>
        /// 显示
        /// </summary>
        /// <returns>集合</returns>
        IQueryable<T> GetAllAsync();
        int Del(T t);
        Task<int> GetChildrenCountAsync(int parentId);
    }
}
